﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class AddForm : Form
    {

        String name = " ";
        String SugarMass = " ";
        ComboBox box;
        ComboBox box2;
        ComboBox box3;
        ComboBox box4;

        public AddForm()
        {
            InitializeComponent();
        }

        public AddForm(ComboBox temp, ComboBox temp2, ComboBox temp3, ComboBox temp4) {
            box = temp;
            box2 = temp2;
            box3 = temp3;
            box4 = temp4;
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            name = textBox1.Text;
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            SugarMass = textBox2.SelectedText;
        }

        private void AddForm_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            //add sugar to list of combox boxes here
            if (box != null)
            {
                box.Items.Add(name);
                box2.Items.Add(name);
                box3.Items.Add(name);
                box4.Items.Add(name);
            }
            
            this.Close();
        }
    }
}
